<template>
	<view class="wrap beijing">
		<view class="my-head-bar fc-bet">
			<view class="">

			</view>
			<view class="fc">
				<navigator url="/pages/customer/customer" style="background-color: transparent;">
					<image src="../../../static/img/about/icon-zxkf.png" mode=""></image>
				</navigator>
				<navigator style="background-color: transparent;    margin-left: 0.96rem;">
					<image src="../../../static/img/about/icon-xiaoxi.png" mode=""></image>
				</navigator>
			</view>
		</view>
		<view class="my-head-info m022">
			<view class="fc">
				<view class="avator">
					<image style="width: 100%;height: 100%;" src="@/static/img/index/avatar.png" mode="scaleToFill"></image>
				</view>
				<view class="txt">
					<view class="h3">
						{{userInfo.phoneNumber}}
					</view>
					<view class="p">
						<text v-if="userInfo.membershipStatus">({{userInfo.membershipStatus}}) </text><text v-if="userInfo.teamMemberStatus">({{userInfo.teamMemberStatus}})</text>
					</view>
				</view>
			</view>
		</view>
		<view class="my-head-info2 m022 wdzc-box">

			<view class="col">
				<text>总资产</text>
				<view class="zcmoney "><b class="je_user_zjemoney">{{userInfo.totalAssets}}</b></view>
			</view>

			<view class="col">
				<text>待收益</text>
				<view class="zcmoney "><b class="je_user_dfhmoney">{{userInfo.pendingEarnings}}</b></view>
			</view>

			<view class="col">
				<text>总收益</text>
				<view class="zcmoney "><b class="je_user_ljsymoney">{{userInfo.totalEarnings}}</b>

				</view>
			</view>
			<view class="col">
				<text>可提余额</text>
				<view class="zcmoney "><b class="je_user_ktmoney">{{userInfo.withdrawableBalance}}</b></view>
			</view>

			<view class="col">
				<text>我的积分</text>
				<view class="zcmoney "><b class="je_user_jfmoney">{{userInfo.points}}</b></view>
			</view>

			<view class="col">
				<text>累计充值</text>
				<view class="zcmoney "><b class="je_user_ljczmoney">{{userInfo.totalEarnings}}</b></view>
			</view>

			<view class="col">
				<text>累计提现</text>
				<view class="zcmoney "><b class="je_user_ljtxmoney">{{userInfo.totalWithdraw}}</b></view>
			</view>
		</view>
		<view class="my-menus m022 fc-bet">
			<navigator class="a" url="/pages/tabBar/my/recharge/qrcodepay">
				<view class="icon">
					<image src="@/static/img/about/64d07d4c11e6516913851648407.png" alt=""></image>
				</view>
				<text>充值</text>
			</navigator>
			<navigator class="a" url="/pages/tabBar/my/payment/withdrawal">
				<view class="icon">
					<image src="@/static/img/about/64d07d635a6b31691385187877.png" alt=""></image>
				</view>
				<text>提现</text>
			</navigator>
			<navigator class="a" url="/pages/tabBar/my/luckyDraw">
				<view class="icon">
					<image src="@/static/img/about/64d07d71c598d16913852019365.png" alt=""></image>
				</view>
				<text>抽奖</text>
			</navigator>
			<navigator class="a" url="/pages/index_sc/index_sc">
				<view class="icon">
					<image src="@/static/img/about/64d07d8353d5116913852192039.png" alt=""></image>
				</view>
				<text>商城</text>
			</navigator>
			<navigator class="a" @tap="gopri">
				<view class="icon">
					<image src="@/static/img/about/64d07daecaaab16913852628561.png" alt=""></image>
				</view>
				<text>项目</text>
			</navigator>
		</view>
		<view class="availableBalance-box m022 on">
			<view class="money-box">
				<view class="fc-bet">
					<view class="left">
						<view class="fc" style="align-items: center;display: flex;">
							<text class="p">可用余额</text>
							<navigator class="a fc">
								<image src="@/static/img/about/bg-question.png" mode=""></image>
							</navigator>
						</view>
						<view class="b je_user_money">
							<template v-if="eye">{{userInfo.availableBalance}}.00</template>
							<template v-else>******</template>
						</view>
					</view>
					<view class="right">
						<view class="fc">
							<text class="p">昨日收益</text>
							<view class="fc a btn-eye" @tap="showYesterdayEarnings">
								<image style="width: 100%; height: 100%;" :src="eye ? eyeimg.i1 : eyeimg.i2"
									mode="widthFix"></image>
							</view>
						</view>
						<view ref="eyes" class="b je_user_zzrsymoney">
							<template v-if="eye">{{ yesterdayEarnings }}</template>
							<template v-else>******</template>
						</view>
					</view>
				</view>
			</view>
			<u-notice-bar icon="" :text="text1" direction="column"></u-notice-bar>
		</view>
		<view class="box-title m022 fc-bet">
			<view class="fc">
				<i></i>
				<text class="h3">我的订单</text>
			</view>
			<view class="right">
				<navigator class="more fcc"><text>查看&gt;</text></navigator>
			</view>
		</view>
		<view class="my-menus myOrder-menus m022 fc-bet">
			<navigator class="a" url="/pages/index_wdscdd/index_wdscdd?lx=2">
				<view class="icon">
					<image src="@/static/img/about/img-dfk.png" mode="aspectFit" alt=""></image>
				</view>
				<text class="p">待付款</text>
			</navigator>
			<navigator class="a" url="/pages/index_wdscdd/index_wdscdd?lx=4">
				<view class="icon">
					<image src="@/static/img/about/img-dfh.png" mode="aspectFit" alt=""></image>
				</view>
				<text class="p">待发货</text>
			</navigator>
			<navigator class="a" url="/pages/index_wdscdd/index_wdscdd?lx=5">
				<view class="icon">
					<image src="@/static/img/about/img-dhs.png" mode="aspectFit" alt=""></image>
				</view>
				<text class="p">待收货</text>
			</navigator>
			<navigator class="a" url="/pages/index_wdscdd/index_wdscdd?lx=7">
				<view class="icon">
					<image src="@/static/img/about/img-sh.png" mode="aspectFit" alt=""></image>
				</view>
				<text class="p">售后</text>
			</navigator>
		</view>
		<view class="share-g m022">
			<navigator url="/pages/index_tjhy/index_tjhy" class="a img">
				<image src="@/static/img/about/d436724a667af1d4ca1700306146ef45.png" mode="aspectFit" alt="">
				</image>
			</navigator>
		</view>
		<view class="my-navs m022">
			<navigator class="a" url="/pages/index_jika/index_jika">
				<view class="icon">
					<image src="@/static/img/about/64f098f2ed7ff16934893941539.png" mode="aspectFit" alt="">
					</image>
				</view>
				<text class="p">集 福</text>
			</navigator>
			<navigator class="a" url="/pages/index_qiandao/index_qiandao">
				<view class="icon">
					<image src="@/static/img/about/64d07e29733bf1691385385982.png" mode="aspectFit" alt=""></image>
				</view>
				<text class="p">每日签到</text>
			</navigator>
			<navigator class="a" url="/pages/tabBar/my/account_details">
				<view class="icon">
					<image src="@/static/img/about/64d07e3e75b9d16913854062092.png" mode="aspectFit" alt=""></image>
				</view>
				<text class="p">账户详情</text>
			</navigator>
			<navigator class="a" url="/pages/tabBar/my/payment/payway">
				<view class="icon">
					<image src="@/static/img/about/64d07e51842191691385425696.png" mode="aspectFit" alt=""></image>
				</view>
				<text class="p">收款方式</text>
			</navigator>
			<navigator class="a" url="/pages/index_wdtz/index_wdtz">
				<view class="icon">
					<image src="@/static/img/about/64d07e6e8c96516913854548838.png" mode="aspectFit" alt=""></image>
				</view>
				<text class="p">我的投资</text>
			</navigator>
			<navigator class="a" url="/pages/index_quyudaili/index_quyudaili">
				<view class="icon">
					<image src="@/static/img/about/64d2dabe7334116915401588866.png" mode="aspectFit" alt=""></image>
				</view>
				<text class="p">区域代理</text>
			</navigator>
			<navigator class="a" url="/pages/tabBar/my/member/member">
				<view class="icon">
					<image src="@/static/img/about/64d1ed8cea76216914794368545.png" mode="aspectFit" alt=""></image>
				</view>
				<text class="p">我的会员</text>
			</navigator>
			<navigator class="a" url="/pages/index_wdtz/index_wdtz">
				<view class="icon">
					<image src="@/static/img/about/64d1eda353dbc16914794596947.png" mode="aspectFit" alt=""></image>
				</view>
				<text class="p">我的卡券</text>
			</navigator>
			<navigator class="a" url="/pages/index_wdtz/index_wdtz">
				<view class="icon">
					<image src="@/static/img/about/64d1edc2d1f5416914794904615.png" mode="aspectFit" alt=""></image>
				</view>
				<text class="p">邀请好友</text>
			</navigator>
			<navigator class="a" url="/pages/index_wdtz/index_wdtz">
				<view class="icon">
					<image src="@/static/img/about/64d1edc2d1f5416914794904615.png" mode="aspectFit" alt=""></image>
				</view>
				<text class="p">我的团队</text>
			</navigator>
			<navigator class="a" url="/pages/tabBar/my/zjmx">
				<view class="icon">
					<image src="@/static/img/about/64d206ec43cda16914859326828.png" mode="aspectFit" alt=""></image>
				</view>
				<text class="p">资金明细</text>
			</navigator>
			<navigator class="a" url="/pages/index_wdtz/index_wdtz">
				<view class="icon">
					<image src="@/static/img/about/64d207050758a1691485957448.png" mode="aspectFit" alt=""></image>
				</view>
				<text class="p">卡卷记录</text>
			</navigator>
			<navigator class="a" url="/pages/index_wdtz/index_wdtz">
				<view class="icon">
					<image src="@/static/img/about/64d2072d3151316914859978571.png" mode="aspectFit" alt=""></image>
				</view>
				<text class="p">积分记录</text>
			</navigator>
			<navigator class="a" url="/pages/index_wdtz/index_wdtz">
				<view class="icon">
					<image src="@/static/img/about/64d207481360816914860243902.png" mode="aspectFit" alt=""></image>
				</view>
				<text class="p">提现记录</text>
			</navigator>
			<navigator class="a" url="/pages/tabBar/my/Draw/drawhistory">
				<view class="icon">
					<image src="@/static/img/about/64d207050758a1691485957448.png" mode="aspectFit" alt=""></image>
				</view>
				<text class="p">抽奖记录</text>
			</navigator>
			<navigator class="a" url="/pages/index_wdtz/index_wdtz">
				<view class="icon">
					<image src="@/static/img/about/64d207787045a16914860724851.png" mode="aspectFit" alt=""></image>
				</view>
				<text class="p">平台转账</text>
			</navigator>
			<navigator class="a" url="/pages/index_wdtz/index_wdtz">
				<view class="icon">
					<image src="@/static/img/about/64d20794123a916914861004328.png" mode="aspectFit" alt=""></image>
				</view>
				<text class="p">个人设置</text>
			</navigator>
			<!-- 继续添加其他导航链接 -->
		</view>
		<view class="page-safe fc-bet m022" style="margin-top: 1rem;">
			<view class="col fc">
				<image src="@/static/img/index/64caef0ce800916910210687561.png" alt=""></image>
				<view>
					<p>风险保障</p>
					<p>多重管控</p>
				</view>
			</view>
			<view class="col fc">
				<image src="@/static/img/index/64caeefc74a0416910210527104.png" alt=""></image>
				<view>
					<p>签订银行</p>
					<p>存管协议</p>
				</view>
			</view>
			<view class="col fc">
				<image src="@/static/img/index/64caeef7ee37c16910210474658.png" alt=""></image>
				<view>
					<p>ICP认证</p>
					<p>安全可靠</p>
				</view>
			</view>
		</view>
		<view class="m022">
			<view class="w100 fcc btn-blue" @click="goOut">
				安全退出
			</view>
		</view>
		<view style="height: 3rem;">
			
		</view>
	</view>
</template>

<script>
	import {
		mapGetters
	} from 'vuex';
	export default {
		data() {
			return {
				text1: [
					'寒雨连江夜入吴',
					'平明送客楚山孤',
					'洛阳亲友如相问',
					'一片冰心在玉壶'
				],
				sum: '181.00',
				yesterdayEarnings: '0.00',
				eye: true,
				eyeimg: {
					i1: '../../../static/img/about/yj_xs.png',
					i2: '../../../static/img/about/yj_yc.png'
				},
				userid: '',
				userInfo: {}
			}
		},
		computed: {
			// ...mapGetters('getters', ['userInfo']),
		},
		mounted() {

			this.getUser()
		},
		methods: {
			gopri(){
			   uni.switchTab({
			   	url: '/pages/tabBar/project/index'
			   });
			},
			 getUser() {
				const user = this.$store.getters['User'];
				this.$request.get(`/CatUser/${user.userId}`, {}).then(res => {
				                    console.log(res);
						if(res.code=200){
							this.userInfo=res.data.user
							this.$store.dispatch('setUserInfo',this.userInfo)
						}
					    else{
							this.$refs.uToast.show({
								type: 'success',
								title: '成功主题(带图标)',
								message: '服务器异常',
								iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'

							})
						}
					}

				)
			},
			showYesterdayEarnings() {
				this.eye = !this.eye
				console.log(this.$refs.eyes);
			},
			goOut() {
				const cattoken = this.$store.state.cattoken;
				this.$request.post('/CatUser/logout', {
						token: cattoken
					})
					.then(res => {
						// 处理请求成功的情况
						uni.redirectTo({
							url: '/pages/login/index'
						})
					})
					.catch(error => {
						// 处理请求失败的情况
						console.error('GET request failed:', error);
					});
			}

			//   async goOut(){

			//    console.log('jjjjjj');
			// 	const data=await this.$request.post('/cgt-user/logout', {});
			// 	console.log(data);
			// }
		}
	}
</script>

<style>
	.avator {
		margin-left: 0.66rem;
		margin-right: 0.66rem;
		width: 2.04rem;
		height: 2.04rem;
		border-radius: 3rem;
	}

	.wdzc-box {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
	}

	.my-menus .icon {
		width: 1rem;
		height: 0.92rem;
		margin-bottom: 0.22rem;
		display: flex;
		align-items: center;
		justify-content: center;
	}

	.btn-eye {
		margin-left: 0.32rem;
		width: 0.88rem;
		height: 0.88rem;
		display: block;
	}

	.share-g image {
		border-radius: 0.4rem;
		display: block;
		width: 100%;
		height: 3rem;
	}
</style>